import { toRaw, isReactive, isRef } from "vue";

export default function () {
    const sendEvent = (name, arags) => {
        const rawArgs =
            isReactive(arags) || isRef(arags) ? toRaw(arags) : arags;
        return window.electron[name](rawArgs);
    };

    return sendEvent;
}
